﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DinnerParty2
{
    class Dinner
    {
        const int costOfFoodPrice = 25;
        private int numberOfpeople;

        public int NumberOfPeople
        {
            get
            {
                return numberOfpeople;
            }
            set
            {
                numberOfpeople = value;
                calculateCostOfDecorations(fancyDecorations);
            }
        }
        public decimal costOfbeveragesPerPerson;
        public decimal costOfdecorations;
        private bool fancyDecorations;

        public Dinnerparty(int numberOfpeople, bool healthyOption, bool fancyDecorations)
        {
            NumberOfPeople = numberOfpeople;
            this.fancyDecorations = fancyDecorations;
            setHealthyOption(healthyOption);
            calculateCostOfDecorations(fancyDecorations);

        }
    

        public int NumberOfPeople
        {
            get
            {
                return numberOfpeople;
            }
            set
            {
                numberOfpeople = value;
                calculateCostOfDecorations(fancyDecorations);
            }
        }
      
        public void setHealthyOption(bool healthyOption)
        {
            if (healthyOption)
            {
                costOfbeveragesPerPerson = 5.0M;
            }
            else
            {
                costOfbeveragesPerPerson = 20.0M;
            }
        }
        public void calculateCostOfDecorations(bool fancy)
        {
            if (fancy)
            {
                costOfdecorations = (NumberOfpeople * 15.0M) + 30.0M;
            }
            else
            {
                costOfdecorations = (numberOfpeople * 7.50M) + 50.0M;
            }
       
        }
        public decimal calculateCost(bool healthyOption)
        {
            decimal totalCost = costOfdecorations + (costOfbeveragesPerPerson + costOfFoodPrice) * NumberOfpeople;
            if (healthyOption)
            {
                return totalCost * .95M;
            }
            else
            {
                return totalCost;
            }

        }

    }
}
